//======================================================================
/// COPYRIGHT MorningCoreTech CO.,LTD
/// @file        PUCCH_DmrsSeq_Gen_fix.cpp
/// @brief       This function performs PUCCH DmrsSeq Gen Proc
/// @author      cuiyuping
/// @param [IN]	     SimParam		               Input  Parameter .
/// @param [IN]	     PUCCH_DMRS_Ip		           DMRS Seq
/// @param [OUT]	 PUCCH_ZC_Data		           Data Seq     

/// @par History
/// -
///       Date|       Author|        Version|        DESCRIPTION
/// ----------|-------------|---------------|-------------------
/// 2022-10-20|   cuiyuping |          0.0.1|            created
//======================================================================
#include "../common/head/ue_tx_rsgen_fix.h"
#include "ue_tx_pucch_FilePrintf.h"

void PUCCH_DmrsSeq_Gen_fix(IN stULParamTable *SimParam,
	OUT cmplx_frN *PUCCH_DMRS_Ip[PUCCH_DMRS_MAX_NUM],
	OUT cmplx_frN *PUCCH_ZC_Data[PUCCH_DATA_MAX_NUM])
{	
	int j;
	int N_RotateCoef = 14;	
	int8 N_hop,n_hop;
	if (SimParam->intra_slot_hopping==1)
	{
		N_hop = 2;
	}
	else
	{
		N_hop = 1;
	}
	for(n_hop = 0;n_hop < N_hop; n_hop++) 
	{
	
		if (SimParam->PUCCH_Format == PUCCH_FORMAT_0)
		{
			for (j=0; j<SimParam->DataSymNum; j++)  // processing reference signal for data
			{				

					RSGen_fix_ReleaseFlag(
						SimParam->PUCCH_RB_Num,		// number of sub-carriers of RS
						SimParam->PUCCH_DataShift[j],
						SimParam->Omiga,				// Omiga in 3GPP TS 38.211
						0,					// Delta in 3GPP TS 38.211
						SimParam->PUCCH_RS_u[n_hop],		// u in 3GPP TS 38.211
						SimParam->PUCCH_RS_v[n_hop],		// v in 3GPP TS 38.211
						0,      // alpha = 2*pi*Ncs/12 for 0; alpha = 2*pi*Ncs/8 for 1
						1,		//added by zhangyanqun@20180613 for mul ncs flag	        
						N_RotateCoef,
						PUCCH_ZC_Data[j]	// output of RSGen
					);

			}
		}
		for (j=0; j<SimParam->DmrsSymNum; j++)        // processing reference signal for DMRS
		{
			RSGen_fix_ReleaseFlag(
				SimParam->PUCCH_RB_Num,		// number of sub-carriers of RS
				SimParam->PUCCH_DmrsShift[j],
				SimParam->Omiga,				// Omiga in 3GPP TS 38.211
				0,					// Delta in 3GPP TS 38.211
				SimParam->PUCCH_RS_u[n_hop],		// u in 3GPP TS 38.211
				SimParam->PUCCH_RS_v[n_hop],		// v in 3GPP TS 38.211
				0,			        // alpha = 2*pi*Ncs/12 for 0; alpha = 2*pi*Ncs/8 for 1
				1,//added by zhangyanqun@20180613 for mul ncs flag
				N_RotateCoef,
				PUCCH_DMRS_Ip[j]	// output of RSGen
			);

		}
	}
	
}
